<HTML>
<HEAD>
<TITLE>
FileWriter.h
</TITLE>
</HEAD>
<BODY>
<PRE>


<font color="blue">#ifndef</font> SNL_FILEWRITER_H

<font color="blue">#define</font> SNL_FILEWRITER_H


<font color="blue">#include</font><font color="maroon">&#60;string&#62;</font>
<font color="blue">#include</font><font color="maroon">&#60;fstream&#62;</font>
<font color="blue">#include</font><font color="maroon">&#60;iostream&#62;</font>
<font color="blue">using</font> <font color="blue">namespace</font> std;

<font color="blue">enum</font> WRITERTYPE
<font color="black">{</font>
    console <font color="black">=</font><font color="maroon">0</font>,
    file <font color="black">=</font><font color="maroon">1</font>,
    all <font color="black">=</font><font color="maroon">2</font>,
    none <font color="black">=</font><font color="maroon">-1</font>
<font color="black">}</font>;


<font color="blue">class</font> FileWriter
<font color="black">{</font>
<font color="blue">public</font><font color="black">:</font>

    <font color="green">//constructor</font>
    FileWriter<font color="black">(</font>WRITERTYPE wt,string fn<font color="black">)</font>;

    <font color="green">//append string to the file or the buffer stream</font>
    <font color="blue">void</font> appendTo<font color="black">(</font>string str<font color="black">)</font>;


<font color="blue">private</font><font color="black">:</font>


    <font color="blue">bool</font> m_writeToConsole<font color="black">(</font>string str<font color="black">)</font>;
    <font color="blue">bool</font> m_writeToFile<font color="black">(</font>string str<font color="black">)</font>;

    WRITERTYPE writertype;
    ofstream outfile;
    string fileName;
<font color="black">}</font>;

<font color="blue">#endif</font>


</PRE>
</BODY>
</HTML>
